import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.function.Consumer;

public class Test10 {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
//        Iterator<String> it=list.iterator();
        /*while(it.hasNext()){
            System.out.println(it.next());
        }*/
        /*for(String s:list){
            System.out.println(s);
        }*/
       /* for (String s : list) {
            System.out.println(s);
        }*/
//       list.forEach(( s)->System.out.println(s));
        /*ListIterator<String> it=list.listIterator();
        while(it.hasNext()){
            String s=it.next();
            System.out.println(s);
        }
        while(it.hasPrevious()){
            System.out.println(it.previous());*/


        }
   }



